package com.pignest.hotel.beans;

import java.util.Date;

import org.directwebremoting.annotations.RemoteMethod;

import com.pignest.framework.util.Utils;
import com.pignest.hotel.annotation.Bean;
import com.pignest.hotel.beans.global.BaseBean;
import com.pignest.hotel.system.Hotel;

@Bean("协议单位")
public class ProtocolUnit extends BaseBean {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2324862880450506551L;

	/**协议号**/
	private String protocolNo;
	/**单位名称**/
	private String company;
	/**联系人**/
	private String contactName;
	/**联系电话**/
	private String phone;
	/**是否可挂账**/
	private boolean enableHangUp;
	/**最高限额**/
	private int maxPrice;
	/**目前挂账金额**/
	private int price;
	/**备注**/
	private String remark;
	/**操作时间**/
	private Date opTime;
	/**操作人*/
	private String opUser;
	public ProtocolUnit(){
		
	}
    public ProtocolUnit(String protocolNo,String company,String contactName,String phone){
    	this.protocolNo=protocolNo;
    	this.company=company;
    	this.contactName=contactName;
    	this.phone=phone;
    	this.opTime= new Date();
    	this.opUser =Hotel.getCurrentUser().getName();
    }
	public String getProtocolNo() {
		return protocolNo;
	}
	public void setProtocolNo(String protocolNo) {
		this.protocolNo = protocolNo;
	}
	public String getCompany() {
		return company;
	}
	public void setCompany(String company) {
		this.company = company;
	}
	public String getContactName() {
		return contactName;
	}
	public void setContactName(String contactName) {
		this.contactName = contactName;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	public boolean isEnableHangUp() {
		return enableHangUp;
	}
	public void setEnableHangUp(boolean enableHangUp) {
		this.enableHangUp = enableHangUp;
	}
	public int getMaxPrice() {
		return maxPrice;
	}
	public void setMaxPrice(int maxPrice) {
		this.maxPrice = maxPrice;
	}
	public int getPrice() {
		return price;
	}
	public void setPrice(int price) {
		this.price = price;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public Date getOpTime() {
		return opTime;
	}
	public void setOpTime(Date opTime) {
		this.opTime = opTime;
	}
	public String getOpUser() {
		return opUser;
	}
	public void setOpUser(String opUser) {
		this.opUser = opUser;
	}
	@RemoteMethod
	public String getCnIsHangUp()
	{
		if(enableHangUp)
			return "是";
		else
			return "否";
	}
	@Override
	public String toSimpleString() {
		return concat(company,contactName,Utils.toPrice(price));
	}
	
}
